#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

bool perfect( int number ) {
    int n = number;
    vector<int> factor;
    for (int i = 1; i <= n;){ 
        if (n % i != 0) i++;
        else {
            n = n/i;
            factor.push_back(i);
            i = 2;
        }
    }
    bool per = (accumulate(factor.begin(),factor.end(),0) == number);
    if (per) {
        cout << endl << number <<" : ";
        for (vector<int>::iterator j = factor.begin(); j != factor.end(); j++){
            cout << *j << " ";
        }
    }
    return per;
}

int main() {
    for (int k = 1; k <= 1000; ++k) {
        perfect(k);
    }
    return 0;
}
